<?php
	class kehoachhoctap_chitietdata
	{
		public function Them($ct_khht_ma = "", $ct_khht_ma_khht = "", $ct_khht_mamonhoc="",$ct_khht_manamhoc = "", $ct_khht_mahocky = "", $ct_khht_diemchu="")
		{
			$sql = "INSERT INTO kehoachhoctap_chitiet(ct_khht_ma, ct_khht_ma_khht, ct_khht_mamonhoc,ct_khht_manamhoc,ct_khht_mahocky,ct_khht_diemchu)
					VALUES('$ct_khht_ma', '$ct_khht_ma_khht', '$ct_khht_mamonhoc','$ct_khht_manamhoc', '$ct_khht_mahocky', '$ct_khht_diemchu')";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function CapNhat($ct_khht_ma = "", $ct_khht_ma_khht = "", $ct_khht_mamonhoc="",$ct_khht_manamhoc = "", $ct_khht_mahocky = "", $ct_khht_diemchu="")
		{
			$sql = "UPDATE kehocahhoctap_chitiet SET ct_khht_ma_khht = '$ct_khht_ma_khht', ct_khht_mamonhoc= '$ct_khht_mamonhoc',ct_khht_manamhoc = '$ct_khht_manamhoc', ct_khht_mahocky= '$ct_khht_mahocky',ct_khht_diemchu = '$ct_khht_diemchu' WHERE ct_khht_ma = '$ct_khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function Xoa($ct_khht_ma = "")
		{
			$sql = "DELETE FROM kehoachhoctap_chitiet WHERE ct_khht_ma = '$ct_khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function LayDanhSach($ct_khht_ma = "")
		{
			$sql = "SELECT * FROM kehoachhoctap_chitiet WHERE 1";
			
			if($ctdt_ma != "")
				$sql .= " AND ct_khht_ma = '$ct_khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteQuery($sql);
		}
	}
?>